package com.example.tourapp.ui;

import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.example.tourapp.R;

public class Content_food extends AppCompatActivity {
    //组件
    private ImageView food_imge;
    private TextView food_content;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_content_food);
        initView();
        inifunction();
    }

    private void initView() {
        food_imge = (ImageView) findViewById(R.id.food_imge);
        food_content = (TextView) findViewById(R.id.food_content);
    }
    private void inifunction() {
        //获取Intent传过来的数据
        Intent intent=getIntent();
        int f_imge = intent.getIntExtra("food_img", -1);
        String f_content = intent.getStringExtra("food_content");
        //设置数据
        food_imge.setImageResource(f_imge);
        food_content.setText("\u3000\u3000"+f_content);

    }
}